package com.xrh.core.generater.utils;

import java.util.HashMap;
import java.util.Map;

//常量类
public class Constant {
	
	//传化标准框架版本号
	public final static String TRANSFAR_FRAME_VERSION_MARK = "##transfar_frame_version_mark##";
	
	/*控制器action注解*/
	public final static String ACTION_ANNOTATION_MARK = "##action_annotation_mark##";
	
	/*控制器上注解*/
	public final static String CONTROLLER_ANNOTATION_MARK = "##controller_annotation_mark##";
	
	//主键类型替换标记
	public final static String ID_JAVA_TYPE_MARK = "##id_java_type_mark##";
	public final static String ID_JAVA_TYPE_SIMPLE_MARK = "##id_java_type_simple_mark##";
	
	/*dubbo提供者提供接口标记*/
	public final static String DUBBO_PROVIDER_INTERFACE_MARK = "##dubbo_provider_interface_mark##";
	
	/*dubbo消费者依赖接口标记*/
	public final static String DUBBO_CONSUMER_DEPEND_INTERFACE_MARK = "##dubbo_consumer_depend_interface_mark##";
	
	/*数据库替换标记*/
	public final static String JDBC_URL_MARK = "##jdbc_url_mark##";
	public final static String DATABASE_USERNAME_MARK = "##database_username_mark##";
	public final static String DATABASE_PASSWORD_MARK = "##database_password_mark##";
	
	
	/*传化标准工程文件夹常量*/
	public final static String TF56_PROJECT_DIR_NAME = "传化标准工程";
	
	/*使用场景常量*/
	public final static String TF56_SYSTEM = "TF标准框架系统";
	public final static String ONEKEY_SYSTEM = "一键工程系统";
	public final static String SPRINGBOOT_BACK_SYSTEM = "springboot后台系统";
	public final static String[] SCENE = new String[]{Constant.SPRINGBOOT_BACK_SYSTEM , Constant.ONEKEY_SYSTEM , Constant.TF56_SYSTEM };
	
	/*登入方式常量*/
	public final static String OA_LOGIN_METHOD = "OA/小二登入";
	public final static String PARTY_OA_LOGIN_METHOD = "会员OA登陆";
	public final static String PARTY_LOGIN_METHOD = "会员登陆";
	public final static String NO_LOGIN_METHOD = "无";
	
	//删除方式常量
	public final static String LOGIC_DELETE_METHOD = "逻辑删除";
	public final static String PHYSICS_DELETE_METHOD = "物理删除";
	
	//数据库字段类型和jdbctype对照map, key为数据类型,value为jdbctype
	public static final Map<String,String> JDBCTYPE_MAP = new HashMap<String,String>(){
		private static final long serialVersionUID = 1L;
	{
		this.put("BIGINT", "BIGINT");
		this.put("BIT", "BIT");
		this.put("BLOB", "BLOB");
		this.put("CHAR", "CHAR");
		this.put("TEXT", "CLOB");
		this.put("DATE", "DATE");
		this.put("DECIMAL", "DECIMAL");
		this.put("DOUBLE", "DOUBLE");
		this.put("FLOAT", "FLOAT");
		this.put("INT", "INTEGER");
		this.put("BIGINT", "LONG");
		this.put("INTEGER", "INTEGER");
		this.put("NUMERIC", "NUMERIC");
		this.put("REAL", "REAL");
		this.put("SMALLINT", "SMALLINT");
		this.put("TIME", "TIME");
		this.put("DATETIME", "TIMESTAMP");
		this.put("TIMESTAMP", "TIMESTAMP");
		this.put("TINYINT", "TINYINT");
		this.put("VARCHAR", "VARCHAR");
		this.put("JSON", "VARCHAR"); //json字段对照为字符串
	}};
	
	//数据库字段类型和jdbctype对照map, key为数据类型,value为jdbctype
	public static final Map<String,String> ORACLE_JDBCTYPE_MAP = new HashMap<String,String>(){
		private static final long serialVersionUID = 1L;
		{
			this.put("BIT", "BIT");
			this.put("BLOB", "BLOB");
			this.put("CHAR", "CHAR");
			this.put("CLOB", "CLOB");
			this.put("DATE", "DATE");
			this.put("DECIMAL", "DECIMAL");
			this.put("DOUBLE", "DOUBLE"); //自定义的
			this.put("FLOAT", "FLOAT");
			this.put("INT", "INTEGER");
			this.put("INTEGER", "INTEGER");
			this.put("NUMERIC", "NUMERIC");
			this.put("NCHAR", "NCHAR");
			this.put("NCLOB", "NCLOB");
			this.put("REAL", "REAL");
			this.put("SMALLINT", "SMALLINT");
			this.put("TIMESTAMP", "TIMESTAMP");
			this.put("VARCHAR", "VARCHAR");
			this.put("VARCHAR2", "VARCHAR"); 
			this.put("BIGINT", "LONG"); 
		}};
	
	//获取jdbc type
	public static  String getOracleJdbcType(String dbType) {
		String type = ORACLE_JDBCTYPE_MAP.get(dbType);
		return type == null ? "VARCHAR" : type;
	}
    
	//首字母大写的类名标记
	public static final String BIG_CLASSNAME_MARK = "##bigClassName##";
	
	//首字母小写的类名标记
	public static final String LITTLE_CLASSNAME_MARK = "##littleClassName##";
	
	//属性名替换标记
	public static final String PROPERTY_NAME_MARK = "##property_name_mark##";
	
	//java类型名称替换标记
	public static final String JAVA_TYPE_NAME_MARK = "##java_type_name_mark##";
	
	//私有属性文本替换标记
	public static final String PRIVATE_PROPERTY_MARK = "##private_property_mark##";
	
	//get和set方法文本替换标记
	public static final String GET_SET_MARK = "##get_set_mark##";
	
	//首字母大写属性名替换标记
	public static final String BIG_PROPERTY_NAME_MARK = "##big_property_name_mark##";
	
	//对象转map的标记
	public static final String MAP_PUT_MARK = "##object2map##";
	
	//作者名称的标记
	public static final String AUTHOR_NAME_MARK = "##authorName##";
	
	//属性注释替换标记
	public static final String COMMENT_MARK = "##comment_mark##";
	
	//注解标记
	public static final String ANNOTATION_MARK = "##annotation_mark##";
	
	//表名注释替换标记
	public static final String TABLE_COMMENT_MARK = "##table_comment_mark##";
	
	/*mybatis-plus查询条件txt*/
	public static final String MYBATIS_QUERY_TXT = "##mybatis_query_txt##";
	
	//vo包路径的标记
	public static final String VO_PACKAGE_PATH_MARK = "##voPackagePath##";
	
	//controller包路径的标记
	public static final String CONTROLLER_PACKAGE_PATH_MARK = "##controllerPackagePath##";
	
	//domain包路径的标记
	public static final String DOMAIN_PACKAGE_PATH_MARK = "##domainPackagePath##";
	
	//domain包路径的标记
	public static final String DTO_PACKAGE_PATH_MARK = "##dtoPackagePath##";
	
	//包路径
	public static final String ADD_REQUEST_MARK = "##add_request_mark##";
	public static final String UPDATE_REQUEST_MARK = "##update_request_mark##";
	public static final String QUERY_REQUEST_MARK = "##query_request_mark##";
	
	//query包路径的标记
	public static final String QUERY_PACKAGE_PATH_MARK = "##queryPackagePath##";
	
	//service包路径的标记
	public static final String SERVICE_PACKAGE_PATH_MARK = "##servicePackagePath##";
	
	//serviceImpl包路径的标记
	public static final String SERVICEIMPL_PACKAGE_PATH_MARK = "##serviceImplPackagePath##";
	
	//serviceImplTest包路径的标记
	public static final String SERVICEIMPL_TEST_PACKAGE_PATH_MARK = "##serviceImplTestPackagePath##";
	
	//dao包路径的标记
	public static final String DAO_PACKAGE_PATH_MARK = "##daoPackagePath##";
	
	//生成日期的标记
	public static final String GENERATE_DATE_MARK = "##generate_date_mark##";
	
	//项目context-path标记
	public static final String PROJECT_CONTEXT_PATH_MARK = "##project_context_path_mark##";
	
	//自动生成菜单标记
	public static final String AUTO_GENERATE_MENU_JSON = "##auto_generate_menu_json##";
	
	//静态资源项目名称
	public static final String STATIC_HTML_PROJECT_NAME = "##static_html_project_name##";
	
	//项目名标记
	public static final String PROJECT_NAME_MARK = "##project_name_mark##";
	
	//大写主键标记
	public static final String BIG_PRIMARYKEY_NAME = "##big_primarykey_name##";
	
	//小写主键标记
	public static final String LITTLE_PRIMARYKEY_NAME = "##little_primarykey_name##";
	
	//大写主键属性名标记
	public static final String BIG_PRIMARYKEY_PROPERTY_NAME = "##big_primarykey_property_name##";
	
	//小写主键属性名标记
	public static final String LITTLE_PRIMARYKEY_PROPERTY_NAME = "##little_primarykey_property_name##";
	
	//是否删除标记
	public static final String IS_DELETE_VALUE = "##isDeleteValue##";
	
	//表名标记
	public static final String TABLE_NAME_MARK = "##table_name_mark##";
	
	//xml字段名和属性名对照标记
	public static final String COLUMN_PROPERTY_MATCH_MARK = "##column_property_match_mark##";
	
	//插入字段文本替换标记
	public static final String INSERT_COLUMNS_MARK = "##insert_columns_mark##";
	
	//插入字段的值文本替换标记
	public static final String INSERT_COLUMNS_VALUES_MARK = "##insert_columns_values_mark##";
	
	//更新文本替换标记
	public static final String UPDATE_TEXT_MARK = "##update_text_mark##";
	
	//查询sql文本替换标记
	public static final String SEARCH_SQL_MARK = "##search_sql_mark##";
	
	//更新版本号条件标记
	public static final String UPDATE_VERSION_CONDITION_MARK = "##update_version_condition_mark##";
	
	//创建人设置登录信息标记
	public static final String CREATE_MAN_SET_LOGIN_USER_MARK = "##create_man_set_login_user_mark##";
	
	//更新人设置登录信息标记
	public static final String UPDATE_MAN_SET_LOGIN_USER_MARK = "##update_man_set_login_user_mark##";
	
	//登陆信息工具类的导入文本标记
	public static final String LOGIN_CLASS_IMPORT_MARK = "##login_class_import_mark##";
	
	//逻辑删除字段名标记
	public static final String LOGIC_DELETE_PROPERTY_NAME_MARK = "##logic_delete_property_name_mark##";
	
	//注释中 :  逻辑删除 | 物理删除
	public static final String DELETE_TITLE_CN_MARK = "##delete_title_cn_mark##";
	
	//设置删除属性值
	public static final String SET_DELETE_PROPERTY_VALUE_MARK = "##set_delete_property_value_mark##";
	
	//设置删除调用的方法名
	public static final String DELETE_METHOD_NAME_MARK = "##delete_method_name_mark##";
	
	//builder domian属性的set部分
	public static final String BUILD_SET_PROPERTY_VALUE_MARK = "##build_set_property_value_mark##";
	
}
